package com.bqtv.sport.dialog

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import com.bqtv.sport.databinding.DialogSetFriendRemarkBinding
import com.bqtv.sport.databinding.DialogSetTextBinding
import com.hjq.base.BaseDialog

class SetFriendRemarkDialog {
    class Builder(context: Context) : BaseDialog.Builder<Builder>(context) {
        var binding: DialogSetFriendRemarkBinding =
            DialogSetFriendRemarkBinding.inflate(LayoutInflater.from(context), FrameLayout(context), false)

        init {
            setContentView(binding.root)
            setData()
        }

        fun setData(): Builder {


            setOnClickListener(binding.tvCancel, binding.tvConfirm)
            return this
        }

        override fun onClick(view: View) {
            super.onClick(view)
            if (view == binding.tvCancel) {
                dismiss()
            } else if (view == binding.tvConfirm) {
                clickResult?.onconfirmClick(binding.etEdit.text.toString())
                dismiss()

            }
        }
        var clickResult: ClickResult? = null

        interface ClickResult {
            fun onconfirmClick(text: String)
        }
    }
}